﻿@model IEnumerable<TeamOPSchoolCup.Domain.POCO.Event>

@{
    ViewBag.Title = "Index";
}

@section region{
    <link rel="Stylesheet" href="@Url.Content("~/Content/css/Event.css")" type="text/css" />
}

<h1 class="wrappertitel">
    @{if (ViewBag.ParentName != null)
      {
        <text>@ViewBag.ParentName</text>
      }
      else
      {
          <text>Index</text>
      }}

</h1>

<p>
    <a title="Click here to create a new event" href="Html.ActionLink("Create New", "Create")">
        <img class="addlogo" src="@Url.Content("~/Content/images/addlogo.png")" alt="add" />
    <span>Create New</span></a>
</p>
<table>
    <tr class="header">
        <th class="numberHeader" />
        <th>Name</th>
        <th>Measure</th>
        <th>IsOfficial</th>
        <th>NSSF</th>
        <th></th>
    </tr>
@{int index = 1;}
@foreach (var item in Model)
{
    <tr>
        <td class="number">
            @index
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Unit)
        </td>
        <td class="center">
            @Html.DisplayFor(modelItem => item.IsOfficial)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NSSF.Name)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.EventId }) |
            @Html.ActionLink("Details", "Details", new { id = item.EventId }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.EventId })
        </td>
        @{ index += 1; }
    </tr>
}

</table>
